package com.ruoyi.web.controller.h5.feedback;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.dto.HandleQuestionFeedbackDto;
import com.ruoyi.system.dto.QuestionFeedbackAddDto;
import com.ruoyi.system.service.QuestionFeedbackService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("question/feedback")
public class QuestionFeedbackController {
    @Resource
    private QuestionFeedbackService questionFeedbackService;

    /**
     * 问题新增
     */
    @PostMapping("/h5/add")
    public AjaxResult addQusetionFeedback(@RequestBody QuestionFeedbackAddDto dto){
        return AjaxResult.success(questionFeedbackService.addQuestionFeedbackAdd(dto));
    }
    /**
     * 问题列表
     */
    @PostMapping("/query/condition")
    public AjaxResult queryQuestionFeedbackBycondition(@RequestBody QuestionFeedbackAddDto dto){
        return AjaxResult.success(questionFeedbackService.queryQuestionFeedbackBycondition(dto));
    }
    /**
     * 操作处理
     */
    @PostMapping("/handle")
    public AjaxResult handleQuestionFeedback(@RequestBody HandleQuestionFeedbackDto dto){
        return AjaxResult.success(questionFeedbackService.handleQuestionFeedback(dto));
    }
    /**
     * 关闭工单
     */
    @PostMapping("/close")
    public AjaxResult closeQuestionFeedback(Long id){
        return AjaxResult.success(questionFeedbackService.closeQuestionFeedback(id));
    }
}
